package com.ganbing518.trace.feign.interceptor;

import feign.RequestInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Description:
 *
 * @author gan bing
 * @version V1.0
 * @date 2018-06-21 9:46
 */
@Configuration
@ConditionalOnProperty(name = "feign.trace.enabled", havingValue = "true")
public class FeignTraceConfiguration {

    @ConditionalOnClass(RequestInterceptor.class)
    @Bean
    public RequestInterceptor getFeignTraceInterceptor(){
        return new FeignTraceInterceptor();
    }

}
